using Domain.Misc;
using System.Collections.Generic;

namespace Domain.Entities
{
    public class Category : IIndexed
    {
        private byte id;
        private string name;
        private short index;

        private IList<Forum> forums;

        public virtual byte Id
        {
            get { return id; }
            internal set { id = value; }
        }

        public virtual string Name
        {
            get { return name; }
            internal set { name = value; }
        }

        public virtual short Index
        {
            get { return index; }
            set { index = value; }
        }

        public virtual IList<Forum> Forums
        {
            get
            {
                IndexedTools.Sort(forums as IList<Forum>);
                return forums;
            }
            internal set { forums = value; }
        }
    }
}
